// Copyright DustedPixels.com 2008. All rights reserved.

package com.dustedpixels.jasmin.video;

/**
 * @author micapolos@gmail.com (Michal Pociecha-Los)
 */
public final class NullVideoOutput implements VideoOutput {
  private int width;
  private int height;
  private int[] frameBuffer;
  
  public int[] beginFrame() {
    if (frameBuffer == null) {
      frameBuffer = new int[width * height];
    }
    return frameBuffer;
  }

  public void endFrame() {
  }

  public boolean needsFrame() {
    return false;
  }

  public void setSize(int width, int height) {
    if (this.width != width || this.height != height) {
      this.width = width;
      this.height = height;
      this.frameBuffer = null;
    }
  }
}
